#include "byte.h"
#include "cowservice.h"

#include "cowlogin.h"


bool CCowCmd::ToNetPack(CXmlBuffer& outbuf)
{
    CXmlBlock block;

    if(!ToNetPack(block))
        return false;

    if(!block.ToBuffer(&outbuf))
        return false;

    return true;
}

CCowService::CCowService() 
: m_inblock(NULL)
{
}

CCowService::~CCowService()
{
}

void CCowService::Initialize(CXmlBlock* inblock, CCowMysql* mysql)
{
	m_inblock = inblock; m_mysql = mysql;
}

CCowService* CCowSrvFactory::Create(const char* name)
{
    creator_srv_map::iterator iter = m_creatormap.find(name);

    if(iter == m_creatormap.end())
        return NULL;

    return  m_creatormap[name]();
}

CCowSrvFactory::CCowSrvFactory()
{
    REG_SERVICE(Login);
}
